const http = uni.$u.http
function getConfig(config) {
    return {
        ...config,
        header: {
            Accept: 'application/json'
        }
    }
}
// post请求，获取菜单
export default {
    // 逆解析定位地址
    getGeocoder(params) {
        return http.get("/index/geocoder", {params})
    },
    // 获取用户信息
    register: (data, config = {}) => http.post('/user/register', data), // 注册
    login: (data, config = {}) => http.post('/user/login', data), // 登录
    getUserInfo: (data, config = {}) => http.get('/user/' + data.id),
    updateUser: (data, config = {}) => http.put('/user/' + data.id, data),
    policyDetail: (data, config = {}) => http.get('/policy/' + data.id),

    // 城市列表
    getCityList: (data, config = {}) => http.get('/city/list?pid='+ data.pid),
    getCategoryList: (data, config = {}) => http.get('/category/list'),
    getPostCategoryList: (data, config = {}) => http.get('/postCategory/list?pid='+ data.pid),
    // 职位列表
    getPostList: (data, config = {}) => http.get('/post/list', data),
    createPost: (data, config = {}) => http.post('/post', data),
    updatePost: (data, config = {}) => http.put('/post/' + data.id, data),
    deletePost: (data, config = {}) => http.delete('/post/' + data.id),
    updatePostSort: (data, config = {}) => http.put('/post/sort/' + data.id, data),
    getPostDetail: (data, config = {}) => http.get('/post/' + data.id),
    // 文件
    getCompanyFileList: (data, config = {}) => http.get('/companyFile/list', data),
    // 职位申请列表
    getPostJoinList: (data, config = {}) => http.get('/postJoin/list', data),
    updatePostJoin: (data, config = {}) => http.put('/postJoin/' + data.id, data),

    // 企业登陆、注册
    companyLogin: (data, config = {}) => http.post('/company/login', data),
    companyRegister: (data, config = {}) => http.post('/company/register', data),

    createCompanyFile: (data, config = {}) => http.post('/companyFile', data),

    getResumeDetailByUser: (data, config = {}) => http.get('/resume/user?user_id=' + data.user_id),
    getResumeDetail: (data, config = {}) => http.get('/resume/' + data.id),
    saveResume: (data, config = {}) => http.post('/resume', data),

    createPostJoin: (data, config = {}) => http.post('/postJoin', data),
    // rechargeConfig
    getRechargeConfig: (data, config = {}) => http.get('/rechargeConfig/list', data),
    // 发送验证码
    sendCode: (data, config = {}) => http.get('/sendCode', data),
    // 获取协议
    getPolicyList: (data, config = {}) => http.get('/policy/list', data),
}
